﻿<div class="right_col" id="right_col">
<?PHP wp_reset_postdata(); ?>
<!-- FB like -->
<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.buetian.com&amp;send=false&amp;layout=standard&amp;width=450&amp;show_faces=true&amp;font=tahoma&amp;colorscheme=light&amp;action=like&amp;height=20&amp" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:20px;" allowTransparency="true"></iframe>

<!--     sidebar starts here   -->
<div class="sidebar_data single_author_info">
    <h2>Author Bio</h2>
    <label>Name: </label><?PHP the_author_meta("user_firstname"); echo " "; the_author_meta("user_lastname"); ?> <br />
	<label>Department: </label><?PHP echo get_cimyFieldValue(get_the_author_meta( 'ID' ), 'Department');?> <br />
	<label>Batch: </label><?PHP echo get_cimyFieldValue(get_the_author_meta( 'ID' ), 'BATCH-NO'); ?> <br />
	<?PHP $bio= get_the_author_meta("description"); 
	if( strlen($bio) !==0)
		echo '<label>Info: </label>'. rawurlencode($bio). '<br />'
	?>
	<label>Total post: </label> <?PHP echo get_the_author_posts(); ?>
     
</div>


<!-- follower icons div -->
<div class="sidebar_data" >
    <h2>Recent posts</h2>
    <ul class="comment_collection_sidebar">
            <?php 
			// The Query
$the_query = new WP_Query( 'author='.get_the_author_meta( 'ID' ) );

// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post();
	echo '<li>';
	echo '<a href="'. get_permalink(). '">';
	echo get_the_title();
	echo '</a>';
	echo '</li>';
endwhile;
			?>
        <li>
                <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
                    <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
                <?php wp_get_archives( 'type=monthly&format=option&show_post_count=1' ); ?>
                </select>
        </li>
    </ul>
</div>

<!-- custom search+post area -->
<div class="sidebar_data">
    <h2>Services</h2>

<!--    keyboard choose options -->
    <select class="change_keyboard">
        <option title="English layout" selected="selected" value="english">English keyboard</option>
        <option title="Bangla(Rokeya) layout" value="rokeya">Rokeya layout</option>
    </select>

<form action="" id="sidebarInputForm">
    <input type="text" size="45" id="get_input" class="" />
    
	<div class="clear"></div>
    <div class="customActionDivM">
            <div id="divInputSearchThisSite" >
                <input type="radio" name="sidebarInput" class="inputSearch" value="site" />
                <label>Search this Site</label>
            </div>
            <div id="divInputSearchWeb">
                <input type="radio" name="sidebarInput" class="inputSearch" value="web" />
                <label>Search web</label>
            </div>
    </div>
	<script type="text/javascript">$('#get_input').loadHelpIconTooltip();</script>

    <input type="submit" value="Submit" id="get_input_SidebarSubmit" name="submit" class="inputSearch submit" tabindex="6" />
    <!--<input type="reset" value="Reset search box" name="resetSearchBox" class="inputSearch" />-->
</form>

<script language="JavaScript" type="text/javascript">

    $("#get_input").val("").change( function() {
        var temp=$("<a href='"+this.value+"'></a>");
        //console.log(temp);
    });

    $("#get_input_SidebarSubmit").click( function(e){

        var radioValue= $("input[type='radio'][name='sidebarInput']:checked").val();
        var text=$("#get_input").val();
        e.preventDefault();

        switch (radioValue) {
          case 'site':
            //google-custom-search engine codes goes here
			window.open("http://www.google.com/search?as_q="+text+"+ &as_sitesearch="+window.location.host);
          break;

          case 'web':
            window.open("http://www.google.com/search?q="+text,
             "menubar=0, resizable=0, status=1, toolbar=0, location=1");
          break;

          case 'delicious':
            var expression=/(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}\//;
            var flag= expression.test(text);
            if( flag)
            {
                //impliement
            }
            else
                alert("Please enter a valid url to save in delicious...");
            alert(flag);
          break;

          case 'shortener':
            var expression=/(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4}\//;
            var regex= new RegExp(expression);
            var flag= expression.test(text);
            if( flag)
            {
                window.open("http://www.google.com/search?q="+text,
             "menubar=0, resizable=0, status=1, toolbar=0, location=1");
            }
            else
                alert("Please enter a valid url to shorten...");
            alert(flag);
          break;
        }
        //alert($("input[type='radio'][name='sidebarInput']:checked").val());
        //return false;
    });
</script>
</div> <!-- custom search+post area -->




<div class="sidebar_data">
    <h2>Peoples gallery on Flickr</h2>
    <div id="cesc">
<script type="text/javascript"  src="<?php bloginfo('template_url');?>/lib/tinycarousel.js"></script>

<script type="text/javascript">

//var url="http://www.flourish.org/news/flickr-daily-interesting.xml";
var url="http://api.flickr.com/services/feeds/groups_pool.gne?id=741815@N22&lang=en-us";

$.getJSON("https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q="+encodeURI(url),
function(data)
{
	var prevText='<div id="slider-code"><div class="viewport"><ul class="overview">';
	var afterText="</ul></div></div>";
	var images="";

	for(var i=0; i<10; ++i)
	{
		var src=$(data.responseData.feed.entries[i].content).find("img").attr("src");
		var $a=$(data.responseData.feed.entries[i].content).find("img").closest("a");
		images+="<li><a target='_blank' href='"+$a.attr("href")+"'><img style='max-width:300px' src='"+ src+"'/></a></li>";
		//console.log(a);
	}
	
	$("#cesc").append($(prevText+images+afterText));
	$('#slider-code').tinycarousel();
});
</script>
    </div>
</div>


</div> <!-- sidebar div ends here -->